package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.*;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Ticket extends BaseDomain {

    private String name;//门票名

    private BigDecimal price;//门票价格

    private ViewPoint vp;//景点id

    private BigDecimal original_price;//原价

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("price", price);
        map.put("original_price", original_price);
        if (vp != null) {
            map.put("vp", vp);
        }
        return JSONUtil.toJSONString(map);
    }
}